/**
 * 论文学术报告会-接口文件
 */
import fetch from 'common/src/utils/fetch';
import UTILS from "common/src/utils/utils";
const baseUrl = "/api/compulsoryservice";

export const auditTableList = `${baseUrl}/thesisSymposiumApplyInfoT/query`;
export const lookTableList = `${baseUrl}/thesisSymposiumResultT/query`;
export const applyTableList = `${baseUrl}/thesisSymposiumResultT/stuApplyDetail`;

//我的论文阶段成果报告-提交申请、修改
export function apply(data) {
  return fetch({
      url: `${baseUrl}/thesisSymposiumApplyInfoT/apply`,
      method: 'post',
      data
  })
}

//我的论文阶段成果报告-录入意见
export function reviewSuggestionApply(data) {
  return fetch({
      url: `${baseUrl}/thesisSymposiumApplyInfoT/reviewSuggestionApply`,
      method: 'post',
      data
  })
}

//我的论文阶段成果报告-查询表格数据
export function reviewStuApplyDetail(data) {
  return fetch({
      url: `${baseUrl}/thesisSymposiumResultT/stuApplyDetail`,
      method: 'post',
      data
  })
}

//报告会审批-获取审批列表数据
export function getPaperAuditList(data) {
  return fetch({
      url: `${baseUrl}/thesisSymposiumApplyInfoT/query`,
      method: 'post',
      data
  })
}

//报告会审批-获取审批列表-详情
export function getPaperAuditDetail(data) {
  return fetch({
      url: `${baseUrl}/thesisSymposiumApplyInfoT/getDetail?applyId=${data}`,
      method: 'get'
  })
}

//论文阶段成果学术报告会-结果查询-列表
export function getPaperResultList(data) {
  return fetch({
      url: `${baseUrl}/thesisSymposiumResultT/query`,
      method: 'post',
      data
  })
}

//论文阶段成果学术报告会-结果查询-详情
export function getPaperResultDetail(data) {
  return fetch({
      url: `${baseUrl}/thesisSymposiumResultT/getDetail?id=${data}`,
      method: 'get'
  })
}

//论文阶段成果学术报告会-结果查询-详情-申请报告/录入意见
export function getPaperResultApplyDetail(data) {
  return fetch({
      url: `${baseUrl}/thesisSymposiumResultT/getApplyDetail?applyId=${data}`,
      method: 'get'
  })
}

//论文阶段成果学术报告会-结果查询-列表-导出
export function getPaperResultExport(data) {
  return fetch({
      url: `${baseUrl}/thesisSymposiumResultT/export`,
      method: 'post',
      responseType: "blob",
      data,
      timeout: 0
  }).then(res => {
    UTILS.downloadFile(
      res,
      "报告会列表.xls",
      "application/vnd.ms-excel;charset=utf-8"
    );
  });
}

// 我的论文成果阶段报告-获取论文题目接口
export function getPaperTitle(data) {
  return fetch({
      url: `${baseUrl}/thesisSymposiumApplyInfoT/getPaperTitle?yearTerm=${data.yearTerm}&stuNo=${data.stuNo}`,
      method: 'get',

  })
}


//论文阶段报告会-撤回接口
export function auditReject(data) {
  return fetch({
      url: `${baseUrl}/thesisSymposiumApplyInfoT/batchReject`,
      method: 'put',
      data
  })
}
